let http=require('http');

let server=http.createServer((req,res)=>{
    if(req.url=='/favicon.ico'){
        return;
    }

    res.setHeader('Content-Type','text/html;charset=utf-8');

    if(req.url=='/'||req.url=='/index/index'){
        res.end('首页');
    }else if(req.url=='/index/login'){
        res.end('登入');
    }else if(req.url=='/index/reg'){
        res.end('注册');
    }else if(req.url=='/user/info'){
        res.end('用户中心');
    }else if(req.url=='/user/product'){
        res.end('产品列表');
    }else if(req.url=='/user/order'){
        res.end('订单列表');
    }
    else{
        res.end('404 无法找到页面');
    }
    // console.log(req.url);
    // console.log(res.url);
    
    // res.end('张三');
})
server.listen(100,'www.fdsfdsfs.com',()=>{
    console.log('服务器创建成功，打开浏览器输入网址：www.fdsfdsfs.com:100')
});
console.log('哈哈');